package chat_client;

import java.util.Scanner;

public class MessageReceptor implements Runnable
{
    private Scanner entry;
    private ChatScreen chatScreen;

    public MessageReceptor(Scanner entry, ChatScreen chatScreen)
    {
	this.entry = entry;
	this.chatScreen = chatScreen;
    }

    public void run()
    {
	while (this.entry.hasNextLine())
	{
	    String message = this.entry.nextLine();
	    this.chatScreen.addMessage(message);
	}
    }
}
